//
//  AppConstant.h
//  MobileSouthChina
//
//  Created by creator on 6/9/14.
//  Copyright (c) 2014 southchina. All rights reserved.
//

#ifndef MobileSouthChina_AppConstant_h
#define MobileSouthChina_AppConstant_h

#define TABBARHEIGHT 49

#define strIsEmpty(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length]<1 ? YES : NO )

#define object2Str(str) ([str isKindOfClass:[NSNull class]] || str == nil || [str length]<1 ? @"" : str )

//广播
/*** --------------------广播名称--------------------------- **/
// 当通讯录有变化的时候接受的广播过滤器
#define CONTACT_CHANGE_BROADCAST  @"ContactChangeMessage"
// 当公众号关注发生变化的时候广播
#define PUBLIC_ATTENTION_BROADCAST  @"PUBLIC_ATTENTION_BROADCAST"
//其他的消息通过本广播接收 code=1:checkin失效; 2:mqtt连接成功; 3:mqtt丢失连接*/
#define OTHER_CHANGE_BROADCAST @"OTHER_CHANGE_BROADCAST"
//天气变化通知消息
#define WEATHER_CHANGE_BROADCAST @"WeatherChangeBroadcast"
//天气预报刷新消息
#define WEATHER_REFRESH_BROADCAST @"WeatherRefreshBroadcast"
//首页删除应用时广播消息
#define HOMEAPP_CHANGE_BROADCAST @"HomeappChangeBroadcast"
//删除消息
#define MESSAGE_DELETE_BROADCAST @"MessageDeleteBroadcast"
//修改工作状态消息
#define CHANGE_WORK_STATUS @"ChangeWorkStatus"
//扫描二维码登陆消息
#define SCAN_LOGIN_MSG @"ScanLoginMsg"

//Font size
#define FONT_SIZE_MIDDLE 17
#define FONT_SIZE_SMALL   15


//基本蓝色调
//#define BASIC_BLUE_COLOR [UIColor colorWithRed:28.0f/255.0f green:56.0f/255.0f blue:118.0f/255.0f alpha:1.0f]
//#define BASIC_BLUE_COLOR [UIColor colorWithRed:0.000 green:0.435 blue:0.733 alpha:1]

//基本蓝色调
#define BASIC_BLUE_COLOR [UIColor colorWithRed:0.0f/255.0f green:131.0f/255.0f blue:255.0f/255.0f alpha:1.0f]

//灰色的间隔线
#define BASIC_GRAYLINE_COLOR [UIColor colorWithRed:212.0f/255.0f green:212.0f/255.0f blue:212.0f/255.0f alpha:1.0f]


//设备数据
#define kUserDefaults [NSUserDefaults standardUserDefaults]
#define kAppDelegate ((SouthChinaAppDelegate*)[UIApplication sharedApplication].delegate)
#define kToolUnit [ToolUnit sharedInstance]
#define kScreenHight [[UIScreen mainScreen] bounds].size.height
#define kStatusBarHight [[UIApplication sharedApplication] statusBarFrame].size.height
#pragma--------------------------------手机屏幕得宽和高----------------------------------------

//屏幕高
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
//屏幕宽
#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width

//列表格子的高度
#define TABLECELLHIGHT 65

//通用登陆用户数据信息字段
#define LOGIN_USER_ID @"USER_ID"
#define LOGIN_USER_REALID @"LOGIN_USER_REALID"
#define LOGIN_USER_PASSWORD @"USER_PASSWORD"
#define LOGIN_USER_REALID @"LOGIN_USER_REALID"
#define LOGIN_USER_NAME @"USER_NAME"
#define LOGIN_USER_ORGID @"USER_ORGID"
#define LOGIN_USER_TYPE @"LOGIN_USER_TYPE"
#define LOGIN_USER_SEX @"LOGIN_USER_SEX"
#define LOGIN_USER_DEPT @"LOGIN_USER_DEPT"
#define LOGIN_USER_PROFNAME @"LOGIN_USER_PROFNAME"
#define LOGIN_USER_CLASS @"LOGIN_USER_CLASS"
#define LOGIN_USER_HEADIMG @"LOGIN_USER_HEADIMG"
#define LOGIN_USER_FRIEDNRANG @"LOGIN_USER_FRIEDNRANG"
#define LOGIN_USER_HOMETEL @"USER_HOMETEL"
#define LOGIN_USER_MOBILE @"USER_MOBILE"
#define LOGIN_USER_EMAIL @"USER_EMAIL"
#define LOGIN_USER_ADDRESS @"LOGIN_USER_ADDRESS"
#define LOGIN_USER_NICKNAME @"LOGIN_USER_NICKNAME"
#define LOGIN_USER_QQ @"LOGIN_USER_QQ"
#define LOGIN_USER_PROV @"LOGIN_USER_PROV"
#define LOGIN_USER_CITY @"LOGIN_USER_CITY"
///20150708个人标签，多个标签以,间隔
#define LOGIN_USER_TAGS @"LOGIN_USER_TAGS"
//20150709工作状态
#define LOGIN_USER_WORKSTATUS @"LOGIN_USER_WORKSTATUS"
//20150713学工号
#define LOGIN_USER_REALUSERID @"LOGIN_USER_REALUSERID"
//20150815
#define LOGIN_USER_LINKINFOSTATE @"LOGIN_USER_LINKINFOSTATE"
//最后一次跟新应用的时间
#define LAST_REFRESH_PUBLIC_TIME @"LAST_REFRESH_PUBLIC_TIME"

#define LOOK_NEWVERSION @"LOOK_NEWVERSION"

//其他用户信息，加上userid
#define CONTACT_VERSION @"CONTACT_VERSION"
#define LINKINFOSTATE @"linkInfoState"

#define APPTYPES @"where dicttypeId ='6'"

#define ISSOUND @"issound"
#define ISVIBRATE @"isvibrate"
#define ISWIFILOADPIC @"iswifiloadpic"
#define IS_SHOW_UNACTIVE_USER @"IS_SHOW_UNACTIVE_USER"






#define FONT_COLOR_THREE RGBCOLOR(51, 51, 51) //#333333
#define FONT_COLOR_FOUR RGBCOLOR(68, 68, 68) //#444444
#define FONT_COLOR_FIVE RGBCOLOR(85, 85, 85) //#555555
#define FONT_COLOR_SIX RGBCOLOR(102, 102, 102) //#666666
#define FONT_COLOR_NINE RGBCOLOR(153, 153, 153) //#999999

#define TABLE_SECTION_HEADER_HEIGHT 22
#define POPUP_MENU_ITEM_HEIGHT 40.0f
#define SEARCH_BAR_HEIGHT 38.0f
#define LEFT_VIEW_ORIGION_X -260.0f
#define RIGHT_VIEW_ORIGION_X 260.0f


#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f \
blue:(b)/255.0f alpha:1.0f]

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f \
alpha:(a)]

//手机当前版本
#define SYSTEMVERSION  [[[UIDevice currentDevice] systemVersion] floatValue]
#define YNEW  ([[[UIDevice currentDevice] systemVersion] floatValue]>7.0?20.0f:0.0f)

#define APPVERSION  @"1.9996"

//版本信息 20150914 这个控制更新
#define DATABASEVERSION @"databaseversion"
//当前版本 20150923，每次版本更新记得修改这个地方的值
//当前版本 20150923，每次数据库版本更新记得修改这个地方的值，数据库版本与应用版本不同
#define CURDATABASEVERSION @"1.01"

//当前应用版本号
#define CURAPPVERSION @"2.0.2"

//#define SERVERIP @"172.16.33.42"
//#define SERVERPORT @"8008"
//#define SERVERNAME @"mqtt"
//#define MQIP @"172.16.33.42"
//#define MQPORT @"1883"
//#define SERVERURI @"execute.jsp"
//#define APPLICATION_ID @"MobileCSU"
//#define MSGBROADCASTNAME @"MessageFromDataengine_csu"
//#define FILENGINEERURL @"http://202.197.71.30:80/fe"
//#define UPLOADBASEURL @"http://202.197.71.30:80"
//#define UPLOADFILEPATH @"/fe/FileServlet";


///以下是测试环境的地址，仅供测试环境使用
/*
 #define SERVERIP @"202.197.71.30"
 #define SERVERPORT @"80"
 #define SERVERNAME @"mqtt" //中南使用
 //#define SERVERNAME @"hnusvr" //湖大使用hnusvr
 #define MQIP @"202.197.71.31"
 #define MQPORT @"80"
 #define SERVERURI @"execute.jsp"
 #define APPLICATION_ID @"MobileCSU"
 #define MSGBROADCASTNAME @"MessageFromDataengine_csu"
 //#define FILENGINEERURL @"http://202.197.71.30:80/fe"
 #define UPLOADBASEURL @"http://202.197.71.30:80"
#define FILENGINEERURL @"http://app.its.csu.edu.cn:80/fe"
//#define UPLOADBASEURL @"http://app.its.csu.edu.cn:80"
 #define UPLOADFILEPATH @"/fe/FileServlet";
*/



 /*#define SERVERIP @"app.its.csu.edu.cn"
 #define SERVERPORT @"80"
 #define SERVERNAME @"mqtt"
 #define MQIP @"202.197.71.15"
 #define MQPORT @"80"
 #define SERVERURI @"execute.jsp"
 #define APPLICATION_ID @"MobileCSU"
 #define MSGBROADCASTNAME @"MessageFromDataengine_csu"
 #define FILENGINEERURL @"http://app.its.csu.edu.cn:80/fe"
 #define UPLOADBASEURL @"http://app.its.csu.edu.cn:80"
 #define UPLOADFILEPATH @"/fe/FileServlet";*/

////中南大学正式环境地址,仅供正式环境使用，在上版本的时候一定要注意改过来
/*
#define SERVERIP @"app.its.csu.edu.cn"
#define SERVERPORT @"80"
#define SERVERNAME @"mqtt"
#define MQIP @"202.197.71.15"
#define MQPORT @"80"
#define SERVERURI @"execute.jsp"
#define APPLICATION_ID @"MobileCSU"
#define MSGBROADCASTNAME @"MessageFromDataengine_csu"
#define FILENGINEERURL @"http://app.its.csu.edu.cn:80/fe"
#define UPLOADBASEURL @"http://app.its.csu.edu.cn:80"
#define UPLOADFILEPATH @"/fe/FileServlet";
*/

//湖南大学正式环境，在上版本时一定要注意改过来
/*
#define SERVERIP @"zwhd.hnu.edu.cn"  //serverName
#define SERVERPORT @"80"  //serverPort
#define SERVERNAME @"mqtt"    //serverProjectName
#define MQIP @"zwhd.hnu.edu.cn"  //msgServerName
#define MQPORT @"9999"    //msgServerPort
#define SERVERURI @"execute.jsp"  //serverUri ?
#define APPLICATION_ID @"mobile_SC" //appId
#define MSGBROADCASTNAME @"MessageFromDataengine_csu" //msgBroadcastName ?
#define FILENGINEERURL @"http://zwhd.hnu.edu.cn:80/fe"
#define UPLOADBASEURL @"http://zwhd.hnu.edu.cn:80"
#define UPLOADFILEPATH @"/fe/FileServlet";
*/


//移动校园门户地址
#define SERVERIP @"wx.chinacreator.com"
#define SERVERPORT @"80"
#define SERVERNAME @"mqtt" //中南使用
#define MQIP @"202.197.71.31"
#define MQPORT @"80"
#define SERVERURI @"execute.jsp"
#define APPLICATION_ID @"mobile_SC"
#define MSGBROADCASTNAME @"MessageFromDataengine_csu"
#define FILENGINEERURL @"http://wx.chinacreator.com:80/fe"
#define UPLOADBASEURL @"http://wx.chinacreator.com:80"
#define UPLOADFILEPATH @"/fe/FileServlet";
#endif
